home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 923 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: rover.ucs.ualberta.ca!news
  2. From: ryangall@gpu.srv.ualberta.ca (Bobby Sixkiller)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: How to use Windows styles .INI file ?
  5. Date: 10 Jan 1996 07:39:01 GMT
  6. Organization: University of Alberta, Edmonton, Canada
  7. Message-ID: <4cvqel$s8s@pulp.ucs.ualberta.ca>
  8. References: <4ctnbk$6bb@senior.nectec.or.th> <1996Jan09.174451.1@gst-soft.demon.co.uk>
  9. NNTP-Posting-Host: async4-15.remote.ualberta.ca
  10. Mime-Version: 1.0
  11. X-Newsreader: WinVN 0.99.2
  12.  
  13. In article <1996Jan09.174451.1@gst-soft.demon.co.uk>, 
  14. cwood@gst-soft.demon.co.uk says...
  15. >
  16. >> TITLE: How to use Windows styles .INI file ?
  17. >> 
  18. >> +Subject      : How to use Windows styles .INI file ?
  19. >> +From         : senee@mozart.inet.co.th (Senee Wongpakdee)
  20. >> +Message-ID   : <4ctnbk$6bb@senior.nectec.or.th>
  21. >> +Organization : Internet Thailand, Bangkok, Thailand.
  22. >> 
  23. >> How can I read/write parameters from Windows style .INI file ? I can't 
  24. >> find any source or library that says about this.
  25.  
  26.  I wrote a couple function that did this, basically, all I did was 
  27. whenever I initialize a parameter in the file, I store the file *. That 
  28. way whenever I want to acess it, I can connect to it directly...also when 
  29. the program can't find a given parameter, I searches the file for it, and 
  30. then if its found, stores the pointer, if not it either sends an error, or 
  31. reinitializes a new parameter....If your having problems with always 
  32. losing the pointer because new variables are addad all the time, you might 
  33. want to give general locations such as location>=fp+500 and <fp+600. and 
  34. search fro those points...its still pretty fast, especially if your file 
  35. is looooooong. Try to keep within a couple hundered from the actual 
  36. location.
  37.  
  38.  I store all the pointers in a data structure which I write to a file upon 
  39. exit,(fwrite) and read from the file (fread) upon start. Its really 
  40. simple, I hope this sort of helps...I cant find the code! 
  41.  
  42.  
  43.